package io.simple.core.chain;


import io.simple.core.RequestContext;
import io.simple.signals.Signal;

import java.nio.ByteBuffer;

/**
 * Created with IntelliJ IDEA.
 * User: rehak
 * Date: 8/20/13
 * Time: 10:42 AM
 * To change this template use File | Settings | File Templates.
 */
public interface Transport<INPUT, OUTPUT> extends AutoCloseable {



//    /**
//     * Creates RequestContext object from raw data
//     *
//     * @param in transport input
//     * @return RequestContext
//     */
//    public RequestContext createRequestContext(INPUT in);
//
//    /**
//     * Creates response from RequestContext
//     *
//     * @param ctx request context
//     * @return raw data response
//     */
//    public OUTPUT createOutput(RequestContext ctx, ByteBuffer data);
//
//    /**
//     * Process received Signal
//     *
//     * @param s  received Signal
//     * @param rc request context
//     * @return return data
//     */
//    public ByteBuffer processSignal(Signal s, RequestContext rc);

    /**
     * Starts transport (binds to socket, start listening)
     */
    public void start() throws Exception;

}
